var express = require('express');
var router = express.Router();
var rf = require("fs");  


/* GET users listing. */
router.get('/', function(req, res, next) {
  res.json([{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'},{index:1,filename:'2016-01-01'}]);
});


router.get('/:id', function(req, res, next) {
  var data=JSON.parse(rf.readFileSync("public/research/data/list.json","utf-8"));  
  res.json(data);
});

router.get('/:pid/:id', function(req, res, next) {
  var data = JSON.parse(rf.readFileSync("public/research/data/detail.json","utf-8"));  ;
  res.json(data);
});


module.exports = router;
